home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Draw / Include / BoundShp.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.6 KB  |  96 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BoundShp.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BOUNDSHP_H
  13. #define BOUNDSHP_H
  14.  
  15. #ifndef CONSTANT_H
  16. #include "Constant.h"
  17. #endif
  18.  
  19. #ifndef BASESHP_H
  20. #include BASESHP_H
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWPOINT_H
  26. #include "FWPoint.h"
  27. #endif
  28.  
  29. #ifndef FWRECT_H
  30. #include "FWRect.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. // Forward Declarations
  41. //========================================================================================
  42.  
  43. /*#if FW_LIB_EXPORT_PRAGMAS
  44. #pragma import on
  45. #endif
  46. //class FW_CLASS_ATTR CDrawPart;
  47. //class FW_CLASS_ATTR FW_CGraphicContext;
  48. #if FW_LIB_EXPORT_PRAGMAS
  49. #pragma import off
  50. #endif
  51.  
  52. class FW_CLASS_ATTR CDrawFacetClipper;*/
  53.  
  54. //========================================================================================
  55. // class CBoundedShape
  56. //========================================================================================
  57.  
  58. class FW_CLASS_ATTR CBoundedShape : public CBaseShape
  59. {
  60. public:
  61.     FW_DECLARE_CLASS
  62.  
  63. public:
  64.     virtual ~CBoundedShape();
  65.  
  66.     // ----- Geometry
  67.     virtual void        SetShapeGeometry(const FW_CPoint& anchorPoint,  const FW_CPoint& currentPoint);
  68.     virtual void        GetRectGeometry(FW_CRect& bounds) const;
  69.     void                SetRectGeometry(const FW_CRect& bounds);
  70.         
  71.     // ----- Dragging
  72.     virtual void        OffsetShape(Environment *ev, FW_CFixed xDelta, FW_CFixed yDelta);
  73.  
  74.     // ----- Resize
  75.     virtual void        ResizeFeedback(FW_CGraphicContext& gc, const FW_PInk& ink, const FW_PStyle& style, 
  76.                                         short whichHandle, const FW_CPoint& mouseLoc);
  77.     virtual void        GetMapRects(short whichHandle, const FW_CPoint& lastLocation,
  78.                                     FW_CRect& srcRect, FW_CRect& dstRect);
  79.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  80.     virtual void        MapShape(Environment *ev, CDrawPart* part, const FW_CRect& srcRect, const FW_CRect& dstRect);
  81.  
  82.     // ----- Persistence
  83.     virtual void         Flatten(FW_CWritableStream& archive);
  84.  
  85. protected:
  86.     CBoundedShape(unsigned short shapeType, unsigned short renderVerb);
  87.     CBoundedShape(FW_CReadableStream& archive);
  88.  
  89. private:
  90.     virtual void         OutlineShape(FW_CGraphicContext& gc, const FW_PInk& ink, const FW_PStyle& style, const FW_CRect& rect) = 0;
  91.  
  92. protected:
  93.     FW_CRect            fRect;
  94. };
  95.  
  96. #endif